package com.zm.springboot.web;

import com.zm.springboot.bean.MyProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class indexActoin {
    @RequestMapping("hello")
    String hello(){
        log.debug("=========debug 调试========");
        log.info("=========info 信息========");
        log.warn("=========warn 告警========");
        log.error("=========error 错误========");
        return "hello";
    }

    @Value("${demo.name:李四}")
    String myname;

    @Value("${demo.age}")
    int myage;

    @RequestMapping("myinfo")
    String myinfo(){
        return myname + "_" + myage;
    }

    @Autowired
    MyProperties myProperties;

    @RequestMapping("myProps")
    MyProperties myProperties(){
        return myProperties;
    }

}
